	<section id="header">
		<div class="container">
			<div class="row">
				<div class="col-md-9">
					<div class="camera_wrap camera_red_skin" id="camera_wrap_2">
						<?php if(isset($banners)): foreach ($banners as $banner):
							$split = explode('.', $banner->b_filename);
							$thumbs = $split[0].'_thumb.'.$split[1];
						?>
						<div data-thumb="<?php echo site_url('home/appimage/banners/thumbnail/'.$thumbs); ?>" data-src="<?php echo site_url('home/appimage/banners/'.$banner->b_filename); ?>" alt="<?php echo $banner->b_origname; ?>">
							<!-- <div class="camera_caption fadeFromBottom">
								<h4><?php echo $banner->b_name; ?></h4> <em><?php echo $banner->b_content; ?></em>
							</div> -->
						</div>
						<?php endforeach; endif; ?>
					</div>
				</div>

				<div class="col-md-3">
					<div class='background-info'>PRODUCT</div>
					<div style='background-color:#f8d4cc; padding:10px' id="carousel-example-generic" class="carousel slide" data-ride="carousel">
						<ol class="carousel-indicators">
							<?php if(isset($produk_home))
								  {
									$i = 0;
									foreach ($produk_home as $product)
									{
										if($i == 0) $class= 'class="active"';
										else $class = '';
							?>
										<li data-target="#carousel-example-generic" data-slide-to="<?php echo $i; ?>" <?php echo $class; ?>></li>
										
							<?php 		$i++;
									} 
								} ?>
						</ol>
						<div class="carousel-inner" role="listbox" style='width:300px;height:300px;min-height:100px !important;'>
							<?php if(isset($produk_home))
							  	{ 
									$i = 0;
									foreach ($produk_home as $product)
									{ 
										
										$isi_berita = htmlentities(strip_tags($product->p_desc)); // membuat paragraf pada isi berita dan mengabaikan tag html
						                $isi = substr($isi_berita,0,220); // ambil sebanyak 220 karakter
						                $isi = substr($isi_berita,0,strrpos($isi," ")); // potong per spasi kalimat

										if($i == 0) $class= 'class="item active"';
										else $class = 'class="item"';
							?>
										<div <?php echo $class;?>>
											<!-- <img src="<?php echo site_url('home/appimage/products/thumbnail/'.$product->p_filename); ?>"  /> -->
											<div style='height:160px;'>
												<?php if(empty($product->p_filename)) { ?>
												<center><img width='170' height='130' src="<?php echo img_theme('logo.png'); ?>" alt="Logo"></center>
												<?php } else { ?>
												<center><a href='<?php echo site_url('products/detail/'.slugify($product->p_name).'/'.$product->p_id); ?>'><img width='170px' max-height='170px' src="<?php echo site_url('products/appimage/products/thumbnail/'.$product->p_filename); ?>" alt="<?php echo $product->p_fileorig; ?>"></a></center>
												<?php } ?>
											</div>
											<div style='height:90px;'>
												<p style='font-size: 13px !important;'><?php echo $isi; ?></p>
											</div>
											<!-- <a style='margin-top:5px;' class="btn btn-danger" href='<?php echo site_url('products/detail/'.slugify($product->p_name).'/'.$product->p_id); ?>'> More </a> -->
										</div>
										
							<?php 		$i++;
									}
								} ?>
						</div>		
					</div>
				</div>

				<div class="col-md-3">
					<ul class="slider2">
				        <li><img src="<?php echo img_theme('haan.png'); ?>"></li>
				        <li><img src="<?php echo img_theme('logo-bendico.png'); ?>"></li>
				        <li><img src="<?php echo img_theme('logo-colatta.png'); ?>"></li>
				    </ul>
				</div>
			</div>
		</div>
	</section>

	<section id="main-body">
		<div class="container">
			<div class="row">
				<div class="col-md-9">
					<div class="row">
						<?php if(isset($articles)): foreach ($articles as $article): ?>
						<div class="col-md-4 col-sm-12 col-xs-12">
							<div class="box-article">
								<img class='img-responsive' src="<?php echo site_url('home/appimage/articles/'.$article->a_filename); ?>" alt="<?php echo $article->a_origname; ?>">
								<div class="caption">
									<a href="<?php echo site_url('articles/detail/'.slugify($article->a_title).'/'.$article->a_id); ?>"><h3 style='margin-bottom:1px !important;color:#b9b9b9;margin-top:0px !important'><?php echo $article->a_title; ?></h3></a>
									<?php 
										$isi_artikel = htmlentities(strip_tags($article->a_desc)); // membuat paragraf pada isi berita dan mengabaikan tag html
						                $isia = substr($isi_artikel,0,300); // ambil sebanyak 220 karakter
						                $isia = substr($isi_artikel,0,strrpos($isia," ")); // potong per spasi kalimat
						            	echo "<p>".$isia."...</p>";
						            ?>
						            <a class='link-article' href="<?php echo site_url('articles/detail/'.slugify($article->a_title).'/'.$article->a_id); ?>">More</a>
								</div>
							</div>
						</div>
						<?php endforeach; endif; ?>
					</div>
					
					<div class="row">
						<?php if(isset($event_home)): foreach ($event_home as $event): ?>
							<div class="col-md-6 col-sm-12 col-xs-12" style='margin-bottom:10px;'>
								<div class="box-event">
									<div class="image">
										<img class='img-responsive' src="<?php echo site_url('home/appimage/events/'.$event->e_filename); ?>" alt="Haan | Kreasi Ibu Juara">
									</div>
									<div class="caption">
										<?php 
											$find = array(" ",":");
											$name_event = str_replace($find,"-",$event->e_name);
										?>
										<h2><a style='color:#FFF !important;' href="<?php echo site_url('events/detail-events/'.$event->e_id.'/'.$name_event)?>"><?php echo $event->e_name ?></a></h2>
										<h4><?php echo date("d F, Y", strtotime($event->e_date)); ?></h4>
									</div>
								</div>
							</div>
						<?php endforeach; endif; ?>
					</div>
					<div class=''>&nbsp;</div>
				</div>

				<div class="col-md-3">
					<!-- <div class="box-title">
						<h4>FIND RECIPES</h4>
					</div>
					<div class="box-input">
						<form action="<?php echo site_url('recipes/result'); ?>" method="post">
							<input class="find-recipes" name="find_serch" placeholder=" Recipes">
						</form>
					</div> -->
					<div>
						<?php
							if(isset($widget_home)): foreach ($widget_home as $widget): 
								if ($widget->widget_place == 1)	echo $widget->widget_source;
							endforeach; endif; 
						?>
					</div>
				</div>
			</div>
		</div>
	</section>

	<section id="recipes">
		<div class="container">
			<div class="row">
				<div class="col-md-12 col-sm-12">
					<div class="divider-recipes">
						<h4>Recipes</h4>
					</div>
				</div>
			</div>
		</div>
		<div class="container">
			<div class="row">
				<div class="col-md-12 col-sm-12" style='margin-top:10px;height:250px;'>
					<div id="oemah-demo" class="owl-carousel owl-theme">
						<?php if(isset($recipes_home)): foreach ($recipes_home as $recipes): ?>
							<div class="item">
								<div class='box-recipes-slide'>
									<div style='margin-left:20px;'>
										<center>
											<?php if(empty($recipes->r_filename)) { ?>
											<img style='width:120px !important; height:120px !important' class="thumbnail col-sm-12" src="<?php echo img_theme('logo.png'); ?>" alt="Logo">
											<?php } else { ?>
											<img style='width:120px !important; height:120px !important' class="thumbnail col-sm-12" src="<?php echo site_url('home/appimage/recipes/'.$recipes->r_filename); ?>" alt="<?php echo $recipes->r_fileorig;?>">
											<?php } ?>
										</center>
									</div>
									<div style='clear:both' class="rating-in-list"><?php $rating = $this->rm->show_rating($recipes->r_id); echo $rating; ?></div>
									<h2 style='margin-top:5px !important;'><a href='<?php echo site_url('recipes/detail/'.slugify($recipes->r_name).'/'.$recipes->r_id); ?>'><?php echo $recipes->r_name; ?></a></h2>
								</div>
							</div>
						<?php endforeach; endif; ?>
					</div>
				</div>
			</div>
		</div>
	</section>